<!DOCTYPE html>
<html>

<head>
  <title>Supersonic Subatomic GraphQL</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/blog/supersonic-subatomic-graphql/" />
  <meta property="og:title" content="Supersonic Subatomic GraphQL" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/blog/supersonic-subatomic-graphql/">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="post">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="active">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="post-page grid-wrapper">
  <div class="width-8-12 width-12-12-m doc-content">
    <div class="grid-wrapper">
      <div class="width-12-12">
        <p>
          <a href="/blog"><i class="fas fa-angle-left"></i> Back to all posts</a>
        </p>
      </div>
      <div class="width-12-12">
        <div class="post-date">
          June 23, 2020 
          
            <span class="tags"><a href="/blog/tag/extension">#extension</a><a href="/blog/tag/graphql">#graphql</a></span>
          
        </div>
        <h1 class="post-title">Supersonic Subatomic GraphQL</h1>
        <div class="grid-wrapper">
          <div class="width-8-12 width-12-12-m byline-wrapper">
            
            
              <img class="headshot" src="https://www.gravatar.com/avatar/c3e7539e1144f33342b9062ce5c0f728">
            
            <p class="byline">By Phillip Kruger</p>
          </div>
          <div class="width-12-12">
              <div class="paragraph">
<p><a href="https://github.com/eclipse/microprofile-graphql">MicroProfile GraphQL</a> is now included in the just released <a href="https://quarkus.io/blog/quarkus-1-5-final-released/">version 1.5.0</a> of Quarkus.</p>
</div>
<div class="sect1">
<h2 id="what-is-graphql"><a class="anchor" href="#what-is-graphql"></a>What is GraphQL?</h2>
<div class="sectionbody">
<div class="quoteblock">
<blockquote>
<div class="paragraph">
<p>"GraphQL is an open-source data query and manipulation language for APIs, and a runtime for fulfilling queries with existing data.
GraphQL interprets strings from the client, and returns data in an understandable, predictable, pre-defined manner.
GraphQL is an alternative, though not necessarily a replacement for REST."</p>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>Read the full <a href="http://spec.graphql.org/draft/">GraphQL Specification</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="why-graphql"><a class="anchor" href="#why-graphql"></a>Why GraphQL ?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The main reasons for using GraphQL are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Avoiding over-fetching or under-fetching data. Clients can retrieve several types of data in a single request or can limit the response data based on specific criteria.</p>
</li>
<li>
<p>Enabling data models to evolve. Changes to the schema can be made so as to not require changes on existing clients, and vice versa - this can be done without a need for a new version of the application.</p>
</li>
<li>
<p>Advanced developer experience:</p>
<div class="ulist">
<ul>
<li>
<p>The schema defines how the data can be accessed and serves as the contract between the client and the server. Development teams on both sides can work without further communication.</p>
</li>
<li>
<p>Native schema introspection enables users to discover APIs and to refine the queries on the client-side. This advantage is increased with graphical tools such as GraphiQL and GraphQL Voyager enabling smooth and easy API discovery.</p>
</li>
<li>
<p>On the client-side, the query language provides flexibility and efficiency enabling developers to adapt to the constraints of their technical environments while reducing server round-trips.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="what-is-microprofile-graphql"><a class="anchor" href="#what-is-microprofile-graphql"></a>What is MicroProfile GraphQL?</h2>
<div class="sectionbody">
<div class="quoteblock">
<blockquote>
<div class="paragraph">
<p>"The intent of the MicroProfile GraphQL specification is to provide a "code-first" set of APIs that will enable users to quickly develop portable GraphQL-based applications in Java.
There are 2 main requirements for all implementations of this specification, namely:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Generate and make the GraphQL Schema available. This is done by looking at the annotations in the users code, and must include all GraphQL Queries and Mutations as well as all entities as defined implicitly via the response type or argument(s) of Queries and Mutations.</p>
</li>
<li>
<p>Execute GraphQL requests. This will be in the form of either a Query or a Mutation. As a minimum the specification must support executing these requests via HTTP."</p>
</li>
</ul>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>Read the full <a href="https://download.eclipse.org/microprofile/microprofile-graphql-1.0/microprofile-graphql.html">MicroProfile GraphQL Specification</a></p>
</div>
<div class="paragraph">
<p>You can now use <a href="https://code.quarkus.io/">code.quarkus.io</a> to get going with Quarkus and include the <a href="https://github.com/smallrye/smallrye-graphql">SmallRye GraphQL Extension</a>.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/supersonic-subatomic-graphql/code_quarkus.png" alt="Code">
</div>
</div>
<div class="paragraph">
<p>This will create a Quarkus starter application with the following dependencies:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
  &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
  &lt;artifactId&gt;quarkus-resteasy&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
  &lt;artifactId&gt;quarkus-junit5&lt;/artifactId&gt;
  &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
  &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
  &lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
  &lt;artifactId&gt;quarkus-smallrye-graphql&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="paragraph">
<p>At the moment, the example application created is a JAX-RS application. There is <a href="https://github.com/quarkusio/quarkus/issues/8134">some work in progress</a> to allow extensions
to define custom examples application, but until then we always get a JAX-RS application. You can remove the <code>quarkus-resteasy</code> dependency as we do not need JAX-RS.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="your-first-graphql-endpoint"><a class="anchor" href="#your-first-graphql-endpoint"></a>Your first GraphQL Endpoint.</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let&#8217;s change the <code>ExampleResource</code> Rest service to be a GraphQL endpoint.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Replace the <code>@Path("/hello")</code> class annotation with <code>@GraphQLApi</code>.</p>
</li>
<li>
<p>Replace the <code>@GET</code> method annotation with <code>@Query</code>.</p>
</li>
<li>
<p>Remove the <code>@Produces(MediaType.TEXT_PLAIN)</code> method annotation and all JAX-RS imports.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>That is it! Your <code>ExampleResource</code> should look like this now:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme;

import org.eclipse.microprofile.graphql.GraphQLApi;
import org.eclipse.microprofile.graphql.Query;

@GraphQLApi
public class ExampleResource {

    @Query
    public String hello() {
        return "hello";
    }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can now run the application using Quarkus dev mode:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">mvn quarkus:dev</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now browse to <a href="http://localhost:8080/graphql-ui/">localhost:8080/graphql-ui/</a> and run the following query:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="javascript" class="language-javascript hljs">{
  hello
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will return:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">{
  "data": {
    "hello": "hello"
  }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Also see the <a href="/guides/microprofile-graphql">MicroProfile GraphQL guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="a-more-detailed-example"><a class="anchor" href="#a-more-detailed-example"></a>A more detailed example</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let&#8217;s look at a more detailed example, get the source from <a href="https://github.com/phillip-kruger/graphql-example">this GitHub project</a>.</p>
</div>
<div class="paragraph">
<p>This is a multi-module application. First compile all modules. In the root:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">mvn clean install</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now browse to the quarkus example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">cd quarkus-example</code></pre>
</div>
</div>
<div class="paragraph">
<p>Look at <code>ProfileGraphQLApi.java</code> that is marked as a <code>@GraphQLApi</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">    @Query("person")
    public Person getPerson(@Name("personId") int personId){
        return personDB.getPerson(personId);
    }</code></pre>
</div>
</div>
<div class="paragraph">
<p>Above method will get a person by <code>personId</code>. As you can see the method is made queryable with the <code>@Query</code> annotation. You can optionally provide the name ("person" in this case),
however the default would be "person" anyway (method name without "get"). You can also optionally name the parameter, but the default would be the parameter name ("personId").</p>
</div>
<div class="paragraph">
<p>The Person Object is a POJO that represents a Person (User or Member) in the system. It has many fields, some that are other complex POJOs:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/supersonic-subatomic-graphql/person.png" alt="Person">
</div>
</div>
<div class="paragraph">
<p>However, the <code>Query</code> annotation makes it possible to query the exact fields we are interested in.</p>
</div>
<div class="paragraph">
<p>Run the example application:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">mvn quarkus:dev</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now browse to <a href="http://localhost:8080/graphql-ui/">localhost:8080/graphql-ui/</a> and run the following query:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="javascript" class="language-javascript hljs">{
  person(personId:1){
    names
    surname
    scores{
      name
      value
    }
  }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Notice that you have 'code insight' in the editor. That is because GraphQL has a schema and also supports introspection.</p>
</div>
<div class="paragraph">
<p>We can request only the fields we are interested in, making the payload much smaller.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/supersonic-subatomic-graphql/graphiql.png" alt="GraphiQL">
</div>
</div>
<div class="paragraph">
<p>We can also combine queries, i.e., lets say we want to get the fields for person 1 as shown above, and also the name and surname for person 2, we can do the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="javascript" class="language-javascript hljs">{
  person1: person(personId:1){
    names
    surname
    scores{
      name
      value
    }
  }
  person2: person(personId:2){
    names
    surname
  }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will return :</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">{
  "data": {
    "person1": {
      "names": [
        "Christine",
        "Fabian"
      ],
      "surname": "O'Reilly",
      "scores": [
        {
          "name": "Driving",
          "value": 15
        },
        {
          "name": "Fitness",
          "value": 94
        },
        {
          "name": "Activity",
          "value": 63
        },
        {
          "name": "Financial",
          "value": 22
        }
      ]
    },
    "person2": {
      "names": [
        "Masako",
        "Errol"
      ],
      "surname": "Zemlak"
    }
  }
}</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="source-fields"><a class="anchor" href="#source-fields"></a>Source fields</h3>
<div class="paragraph">
<p>If you look closely at our query, you will see we asked for the <code>scores</code> field of the person, however, the <code>Person</code> POJO does not contain a <code>scores</code> field.
We added the <code>scores</code> field by adding a <code>@Source</code> field to the person:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">    @Query("person")
    public Person getPerson(@Name("personId") int personId){
        return personDB.getPerson(personId);
    }

    public List&lt;Score&gt; getScores(@Source Person person) {
        return scoreDB.getScores(person.getIdNumber());
    }</code></pre>
</div>
</div>
<div class="paragraph">
<p>So we can add fields that merge onto the output by adding the <code>@Source</code> parameter that matches the response type.</p>
</div>
</div>
<div class="sect2">
<h3 id="partial-results"><a class="anchor" href="#partial-results"></a>Partial results</h3>
<div class="paragraph">
<p>The above example merges two different data sources, but let&#8217;s say the score system is down. We will then still return the data we have, and an error
for the score:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="json" class="language-json hljs">{
  "errors": [
    {
      "message": "Scores for person [797-95-4822] is not available",
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "path": [
        "person",
        "scores2"
      ],
      "extensions": {
        "exception": "com.github.phillipkruger.user.graphql.ScoresNotAvailableException",
        "classification": "DataFetchingException"
      }
    }
  ],
  "data": {
    "person": {
      "names": [
        "Christine",
        "Fabian"
      ],
      "surname": "O'Reilly",
      "scores2": null
    }
  }
}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="native-mode"><a class="anchor" href="#native-mode"></a>Native mode</h3>
<div class="paragraph">
<p>Let&#8217;s run this example in native mode (using graalvm-ce-java11-19.3.2):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">mvn -Pnative clean install</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create a native executable and will now start the application very quickly:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./target/quarkus-example-1.0.0-SNAPSHOT-runner
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,&lt; / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2020-06-11 17:02:55,041 INFO  [io.quarkus] (main) quarkus-example 1.0.0-SNAPSHOT native (powered by Quarkus 1.5.0.Final) started in 0.026s. Listening on: http://0.0.0.0:8080
2020-06-11 17:02:55,041 INFO  [io.quarkus] (main) Profile prod activated.
2020-06-11 17:02:55,041 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jsonb, smallrye-graphql, smallrye-openapi, swagger-ui]</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="in-the-pipeline"><a class="anchor" href="#in-the-pipeline"></a>In the pipeline</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is the first version of the MicroProfile GraphQL Spec and there are many things in the pipeline. One of those is a client.
We are proposing two types of clients:</p>
</div>
<div class="sect2">
<h3 id="dynamic"><a class="anchor" href="#dynamic"></a>Dynamic</h3>
<div class="paragraph">
<p>The dynamic client will allow you to build a query using a builder:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">// Building of the graphql document.
Document myDocument = document(
                operation(Operation.Type.QUERY,
                        field("people",
                                field("id"),
                                field("name")
                        )));

// Serialization of the document into a string, ready to be sent.
String graphqlRequest = myDocument.toString();</code></pre>
</div>
</div>
<div class="paragraph">
<p>For more details see: <a href="https://github.com/worldline/dynaql">github.com/worldline/dynaql</a></p>
</div>
</div>
<div class="sect2">
<h3 id="type-safe"><a class="anchor" href="#type-safe"></a>Type safe</h3>
<div class="paragraph">
<p>The type safe client will be closer to MicroProfile RESTClient. Looking at the same example as above, lets see how we can to use it.
From the root of the project, browse to the <code>quarkus-client</code> folder. This example uses <a href="https://quarkus.io/blog/introducing-command-mode/">Quarkus Command Mode</a> to make a Query.</p>
</div>
<div class="paragraph">
<p>The client is not yet a Quarkus Extension, so we add it in our project like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.smallrye&lt;/groupId&gt;
    &lt;artifactId&gt;smallrye-graphql-client&lt;/artifactId&gt;
    &lt;version&gt;${smallrye-graphql.version}&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now we can create a POJO that contains only fields that we are interested in. Looking at <code>Person</code> and <code>Score</code> in the client module, it is much smaller than the definition on the server side:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/assets/images/posts/supersonic-subatomic-graphql/client.png" alt="Client">
</div>
</div>
<div class="paragraph">
<p>All we need to do now is to add an interface that defines the queries that we are interested in:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@GraphQlClientApi
public interface PersonGraphQLClient {

    public Person person(int personId);

}</code></pre>
</div>
</div>
<div class="paragraph">
<p>And now we can use this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">    //@Inject
    //PersonGraphQLClient personClient; or
    PersonGraphQLClient personClient = GraphQlClientBuilder.newBuilder().build(PersonGraphQLClient.class);

    // ...
    Person person = personClient.person(id);</code></pre>
</div>
</div>
<div class="paragraph">
<p>Running the Quarkus client appication we can now make a call to the server (make sure this is still running) and print the response:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">java -jar target/quarkus-client-1.0.0-SNAPSHOT-runner.jar 2
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
=========================
|  Masako Zemlak        |
|                       |
|        Driving        |
|        48             |
|                       |
|        Fitness        |
|        73             |
|                       |
|        Activity       |
|        62             |
|                       |
|        Financial      |
|        54             |
|                       |
=========================</code></pre>
</div>
</div>
<div class="paragraph">
<p>The number (2) is the <code>personId</code> in our example:</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="summary"><a class="anchor" href="#summary"></a>Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is a short and quick introduction to MicroProfile GraphQL that is now available in Quarkus.
There are many more <a href="https://download.eclipse.org/microprofile/microprofile-graphql-1.0.2/microprofile-graphql.html">features</a>
and even more <a href="https://github.com/eclipse/microprofile-graphql/issues">planned</a>, so stay tuned.</p>
</div>
</div>
</div>
              
          </div>
          <div class="width-12-12"><div class="share-page">
  <a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://quarkus.io/blog/supersonic-subatomic-graphql/&title=Supersonic Subatomic GraphQL" rel="nofollow" target="_blank" title="Share on LinkedIn">
    <img src="/assets/images/share-page/icons_social-linkedin.png"/>
  </a>
  <a class="share-twitter" href="https://twitter.com/intent/tweet?text=Supersonic Subatomic GraphQL&url=https://quarkus.io/blog/supersonic-subatomic-graphql/&via=quarkusio&related=quarkusio" rel="nofollow" target="_blank" title="Share on Twitter">
    <img src="/assets/images/share-page/icons_social-twitter.png"/>
  </a>
  <a class="share-facebook" href="https://facebook.com/sharer.php?u=https://quarkus.io/blog/supersonic-subatomic-graphql/" rel="nofollow" target="_blank" title="Share on Facebook">
    <img src="/assets/images/share-page/icons_social-facebook.png"/>
  </a>
  <a class="share-reddit" href="http://www.reddit.com/submit?url=https://quarkus.io/blog/supersonic-subatomic-graphql/" onclick="window.open(this.href, 'pop-up', 'left=20,top=20,width=900,height=500,toolbar=1,resizable=0'); return false;" title="Share on Reddit" >
    <img src="/assets/images/share-page/icons_social-reddit.png"/>
  </a>
  <a class="share-email" href="mailto:?subject=Supersonic Subatomic GraphQL&amp;body=Supersonic Subatomic GraphQL https://quarkus.io/blog/supersonic-subatomic-graphql/" title="Share via Email" >
    <img src="/assets/images/share-page/icons_social-email.png"/>
  </a>
</div>
</div>
        </div>
      </div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
